package com.recycle.common.enums;

/**
 * 参考价格枚举类
 * @author 17237
 */

public enum ReferenceTypePrice {
    PAPER(5, "0.6"),
    PLASTIC(6, "0.25"),
    GLASS(7, "0.15"),
    METAL(8, "2.0"),
    CLOTH(9, "0.6");

    private final long resourceTypeId;
    private final String price;

    ReferenceTypePrice(long id, String price) {
        this.resourceTypeId = id;
        this.price = price;
    }

    public long getResourceTypeId() {
        return resourceTypeId;
    }

    public String getPrice() {
        return price;
    }

    public static long findResourceTypeId(String price) {
        for (ReferenceTypePrice r : values()) {
            if (r.price.equals(price)) {
                return r.resourceTypeId;
            }
        }
        return 0L;
    }

    public static String findPrice(long resourceTypeId) {
        for (ReferenceTypePrice r :values()) {
            if (r.resourceTypeId==resourceTypeId) {
                return r.price;
            }
        }
        return "";
    }


}
